home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / MacShell / MacShell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-04  |  3.7 KB  |  165 lines  |  [TEXT/MPS ]

  1. #ifndef __CSHELL__
  2. #define __CSHELL__
  3.  
  4. #ifndef __TYPES__
  5. #include <Types.h>
  6. #endif
  7.  
  8. #ifndef __APPLEEVENTS__
  9. #include <AppleEvents.h>
  10. #endif
  11.  
  12. #ifndef __MACSHELLVERSION__
  13. #include "MacShellVersion.h"
  14. #endif
  15.  
  16. #ifndef __FILEFORMAT__
  17. #include "FileFormat.h"
  18. #endif
  19.  
  20. #ifndef __FILES__
  21. #include <Files.h>
  22. #endif
  23.  
  24. #ifndef __PRINTING__
  25. #include <Printing.h>
  26. #endif
  27.  
  28. #ifndef __WINDOWS__
  29. #include <Windows.h>
  30. #endif
  31.  
  32. /********/
  33.  
  34. #ifdef THINK_C
  35. #if THINK_C < 5
  36. #define THINK_PRE_5
  37. #endif
  38. #endif
  39.  
  40. #ifndef THINK_PRE_5
  41. struct FileRec;
  42. typedef struct FileRec *FileRecPtr, **FileRecHndl;
  43.  
  44. typedef void    (*ImageProcPtr)(FileRecHndl frHndl);
  45. typedef void    (*ContentClickProcPtr)(WindowPtr window, EventRecord *event);
  46. typedef void    (*ContentKeyProcPtr)(WindowPtr window, EventRecord *event);
  47. typedef OSErr    (*InitContentProcPtr)(FileRecHndl frHndl, WindowPtr window);
  48. typedef void    (*ResizeContentProcPtr)(WindowPtr window, short oldh, short oldv);
  49. typedef void    (*DrawFrameProcPtr)(FileRecHndl frHndl, WindowPtr window);
  50. typedef void    (*CalcFrameRgnProcPtr)(FileRecHndl frHndl, WindowPtr window, RgnHandle rgn);
  51. #endif
  52.  
  53. typedef struct {
  54.     OSType                    sfType;
  55.     Boolean                    docDirty;
  56.     Boolean                    readOnly;
  57.     short                    refNum;
  58.     FSSpec                    fss;
  59.     WindowPtr                window;
  60. #if THINK_PRE_5
  61.     ProcPtr                    imageProc;
  62.     ProcPtr                    contentClickProc;
  63.     ProcPtr                    contentKeyProc;
  64.     ProcPtr                    initContentProc;
  65.     ProcPtr                    resizeContentProc;
  66.     ProcPtr                    drawFrameProc;
  67.     ProcPtr                    calcFrameRgnProc;
  68. #else
  69.     ImageProcPtr            imageProc;
  70.     ContentClickProcPtr        contentClickProc;
  71.     ContentKeyProcPtr        contentKeyProc;
  72.     InitContentProcPtr        initContentProc;
  73.     ResizeContentProcPtr    resizeContentProc;
  74.     DrawFrameProcPtr        drawFrameProc;
  75.     CalcFrameRgnProcPtr        calcFrameRgnProc;
  76. #endif
  77.     short                    attributes;
  78.     ControlHandle            hScroll;
  79.     ControlHandle            vScroll;
  80.     short                    hArrowVal;
  81.     short                    vArrowVal;
  82.     short                    hPageVal;
  83.     short                    vPageVal;
  84.     short                    hDocSize;
  85.     short                    vDocSize;
  86. } FileStateRec;
  87.  
  88. typedef struct {
  89.     long            windowID[2];        /* Used to match up windows.                    */
  90.     short            endSendInfo;        /* Above is send info.                            */
  91.  
  92.     Boolean            connected;            /* Flag showing we are connected.                */
  93.     AEAddressDesc    remoteLoc;            /* AppleEvents address of remote user.            */
  94.     Str32            remoteName;            /* Name of user connected to.                    */
  95.     Str32            remoteZone;            /* Zone of user connected to.                    */
  96.     Str32            remoteMachine;        /* Machine name of user connected to.            */
  97.     short            endLocalInfo;        /* Above info is for one machine only.            */
  98. } ConnectRec;
  99.  
  100. typedef struct FileRec {
  101.     FileStateRec    fileState;
  102.     ConnectRec        connect;
  103.     TheDoc            doc;
  104. } FileRec;
  105. #if THINK_PRE_5
  106. typedef struct FileRec *FileRecPtr, **FileRecHndl;
  107. #endif
  108.  
  109. struct triplets{
  110.     AEEventClass    theEventClass;
  111.     AEEventID        theEventID;
  112.     ProcPtr            theHandler;
  113. };
  114. typedef struct triplets triplets;
  115.  
  116.  
  117.  
  118. /********/
  119.  
  120. #define kwGrowIcon            1
  121. #define kwHScroll            2
  122. #define kwHScrollLessGrow    6
  123. #define kwVScroll            8
  124. #define kwVScrollLessGrow    24
  125.  
  126. #define kwAppWindow            (kwGrowIcon)
  127.  
  128. #define kCustomEventClass  'CUST'
  129. #define keyAppMessage      'KMSG'
  130. #define keyFSS             'KFSS'
  131. #define keyPascal          'PSTR'
  132. #define keyAppConnect      'KCNT'
  133. #define keyWindowID           'KWND'
  134.  
  135. #define typeAppConnect     'KCNT'
  136. #define typeAppMessage     'KMSG'
  137. #define typeDoubleLong     'DBLL'
  138. #define typePascal         'PSTR'
  139. #define typeTextMessage    'KTXT'
  140.  
  141. #define keyReplyErr        'errn'
  142.  
  143. #define kVersion        100
  144. #define kWrongVersion    100
  145.  
  146. #define kInvalVRefNum    0
  147.  
  148. #define kSaveYes        1
  149. #define kSaveNo            3
  150. #define kSaveCanceled    4
  151.  
  152. #define kOpenYes        1
  153. #define kOpenNo            3
  154.  
  155. #define kDisconnectMssg    0
  156. #define kTextMssg        1
  157.  
  158. #define kMaxNumWindows        65535
  159. #define kMinWindowWidth        200
  160. #define kMinWindowHeight    200
  161. #define kMaxWindowWidth        2000
  162. #define kMaxWindowHeight    2000
  163.  
  164. #endif __CSHELL__
  165.